//
//  UILabel+EL.h
//  jobClient
//
//  Created by 一览ios on 2017/4/24.
//  Copyright © 2017年 YL1001. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface UILabel (EL)

// 改变部分文本样式
- (void)subString:(NSString *)subString fontSize:(CGFloat)fontSize;
- (void)subString:(NSString *)subString font:(UIFont *)font;
- (void)subString:(NSString *)subString color:(UIColor *)color;
- (void)subString:(NSString *)subString font:(UIFont *)font color:(UIColor *)color;
- (void)setAttributeTextWithText:(NSString *)text subText:(NSString *)subString color:(UIColor *)color font:(UIFont *)font;

// 将Label.text中所有指定子串改变颜色
- (void)resetAllSubString:(NSString *)subString color:(UIColor *)color;
// 将Label.text中所有指定子串改变颜色和字体
- (void)resetAllSubString:(NSString *)subString font:(UIFont *)font color:(UIColor *)color;

// 设置行高
- (void)lineSpacing:(CGFloat)spacing;
// 设置段间距
- (void)paragraphSpacing:(CGFloat)spacing;
- (void)paragraphSpacing:(CGFloat)spacing alignment:(NSTextAlignment)alignment;
// 设置行间距、段间距
- (void)lineSpacing:(CGFloat)lineSpacing paragraphSpacing:(CGFloat)paragraphSpacing;
- (void)lineSpacing:(CGFloat)lineSpacing paragraphSpacing:(CGFloat)paragraphSpacing alignment:(NSTextAlignment)alignment;

// 图文混排
- (void)attachmentImage:(UIImage *)image size:(CGSize )size;

// 在字符串中插入图片
- (void)insertAttachmentImage:(UIImage *)image size:(CGSize)size index:(NSInteger)index;
- (void)insertAttachmentImage:(UIImage *)image size:(CGSize)size offsetY:(CGFloat)offsetY index:(NSInteger)index;
 
// 多张图片图文混排
- (void)attachmentImages:(NSArray *)images;
- (void)attachmentImages:(NSArray *)images spacingCount:(NSInteger)spacingCount;

// 自适应宽度
- (CGFloat)flexibleWidth;
- (CGFloat)flexibleWidthWithLineSpacing:(CGFloat)lineSpacing;
+ (CGFloat)flexibleWidthWithText:(NSString *)text font:(UIFont *)font height:(CGFloat)height lineSpacing:(CGFloat)lineSpacing;

// 自适应高度
+ (CGFloat)flexibleHeightWithText:(NSString *)text font:(UIFont *)font width:(CGFloat)width lineSpacing:(CGFloat)lineSpacing;

// 可以计算行数、每行文字
- (NSArray *)linesArray;

@end
